Type Gizmo

	Field piv:TEntity
	Field xaxis:TEntity
	Field yaxis:TEntity
	Field zaxis:TEntity

	Method Create()
	
	EndMethod
	
	
	Method Update()
	
	EndMethod

End Type

Type RotationGizmo Extends Gizmo

	Method Create()
	
		piv = CreateSphere()
		EntityFX(piv,1)
		EntityColor(piv,255,255,255)
		ScaleEntity(piv,0.5,0.5,0.5)
		Local gtex:TTexture = LoadTexture("editores/gizmo.png",3)
		
		xaxis = CreateSphere()
		EntityTexture(xaxis,gtex)
		EntityColor(xaxis,255,0,0)
		EntityFX(xaxis,17)
		EntityRadius xaxis,0.5,4
		ScaleEntity(xaxis,0.25,4,4)
		EntityParent(xaxis,piv)

		yaxis = CreateSphere()
		EntityTexture(yaxis,gtex)
		EntityColor(yaxis,0,255,0)
		EntityFX(yaxis,17)
		EntityRadius yaxis,0.5,4
		RotateEntity(yaxis,0,0,90)
		ScaleEntity(yaxis,0.25,4,4)
		EntityParent(yaxis,piv)

		zaxis = CreateSphere()
		EntityTexture(zaxis,gtex)
		EntityColor(zaxis,0,0,255)
		EntityFX(zaxis,17)
		EntityRadius zaxis,0.5,4
		RotateEntity(zaxis,0,90,0)
		ScaleEntity(zaxis,0.25,4,4)
		EntityParent(zaxis,piv)
		
		EntityOrder piv,-1
		EntityOrder xaxis,-2
		EntityOrder yaxis,-2
		EntityOrder zaxis,-2

		EntityPickMode xaxis,2,False
		EntityPickMode yaxis,2,False
		EntityPickMode zaxis,2,False

	
	EndMethod


EndType


Type TransformGizmo Extends Gizmo

	
	
	Method Create()
	
		piv = CreateCube()
		EntityFX(piv,1)
		EntityColor(piv,255,255,255)
		ScaleEntity(piv,0.5,0.5,0.5)
		xaxis = CreateCube()
		FitMesh(TMesh(xaxis),0,0,0,5,0.25,0.25)
		EntityBox(xaxis,0,0,0,5,0.5,0.5)

		'ScaleEntity(xaxis,5,0.5,0.5)
		'PositionEntity(xaxis,2.5,0,0)
		EntityColor(xaxis,255,0,0)
		EntityFX(xaxis,1)
		EntityParent(xaxis,piv)

		yaxis = CreateCube()
		FitMesh(TMesh(yaxis),0,0,0,0.25,5,0.25)
		EntityBox(yaxis,0,0,0,0.5,5,0.5)
		'ScaleEntity(yaxis,0.5,5,0.5)
		'PositionEntity(yaxis,0,2.5,0)
		EntityColor(yaxis,0,255,0)
		EntityFX(yaxis,1)
		EntityParent(yaxis,piv)

		zaxis = CreateCube()
		FitMesh(TMesh(zaxis),0,0,0,0.25,0.25,5)
		EntityBox(zaxis,0,0,0,0.5,0.5,5)
		'ScaleEntity(zaxis,0.5,0.5,5)
		'PositionEntity(zaxis,0,0,2.5)
		EntityColor(zaxis,0,0,255)
		EntityFX(zaxis,1)
		EntityParent(zaxis,piv)
		
		EntityOrder piv,-2
		EntityOrder xaxis,-1
		EntityOrder yaxis,-1
		EntityOrder zaxis,-1
		
		EntityPickMode xaxis,3,False
		EntityPickMode yaxis,3,False
		EntityPickMode zaxis,3,False
	
	EndMethod

	Method Update()
		
		Super.Update()
	EndMethod
	
EndType
